package demo1;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root= binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("结点个数为(子问题)："+binaryTree.size(root));
        System.out.println("结点个数为(遍历)："+binaryTree.size1(root));
        System.out.println("叶子结点个数为(子问题)："+binaryTree.getLeafNodeCount(root));
        System.out.println("叶子结点个数为(遍历)："+binaryTree.getLeafNodeCount1(root));
        System.out.println("第k层结点的个数："+binaryTree.getKLevelNodeCount(root, 3));
        System.out.println("树的深度为："+binaryTree.getHeight(root));
        System.out.println(binaryTree.find(root, 'H').val);
        System.out.println(binaryTree.find(root, 'Z'));
        System.out.println("-----------------------");
        binaryTree.levelOrder(root);
        System.out.println();
        System.out.println(binaryTree.levelOrderPlus(root));
        System.out.println("------------------------");
        System.out.println(binaryTree.isCompleteTree(root));
        System.out.println("-----------------");
        System.out.println(binaryTree.preorderTraversal(root));
        System.out.println(binaryTree.inorderTraversal(root));
        System.out.println(binaryTree.postorderTraversal(root));
    }
}
